<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选项卡</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 600px;
            height: 400px;
            border: 1px solid black;
            display: flex;
            flex-direction: column;
        }
        .box>ul{
            height: 80px;
            display: flex;
        }
        ul>li{
            flex: 1;
            background-color: blue;
            color: white;
            font-size: 30px;
            text-align: center;
            line-height: 80px;
            list-style: none;
            cursor: pointer;
        }
        ul>li.active{
            background-color: black;
        }
        ol{
            flex: 1;
            position: relative;
        }
        ol>li{
            width: 100%;
            height: 100%;
            display: none;
            justify-content: center;
            align-items: center;
            background-color: yellow;
            color: purple;
            font-size: 50px;
            position: absolute;
            top: 0;
            left: 0;
        }
        ol>li.active{
            display: flex;
        }
    </style>
</head>
<body>
    <div class="box" id="box">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ol>
    </div>
    <script src="./tab.js"></script>
    <script>
        new Tabs("#box","click")
    </script>
</body>
</html>